<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/



Route::get('/', function () {
    return view('welcome');
});

Route::group(['prefix'=>'admin','namespace' => 'Admin','middleware'=>'guest:admin'], function() {
    Route::get('login', 'LoginController@showLoginForm')->name('login');
    Route::post('login', 'LoginController@login');
});

//Auth::routes();
Route::group(['prefix'=>'admin','namespace' => 'Admin','middleware'=>'auth:admin'], function(){
    // Authentication Routes...

    Route::post('logout', 'LoginController@logout')->name('logout');
    Route::get('home', 'HomeController@index');
    Route::get('welcome', 'HomeController@welcome');
    Route::get('admin', 'AdminController@list');
    Route::get('data', 'AdminController@data');

});